/**
 * 
 */
package info;

/**
 * @author vtkhanh
 * 
 */
public class Course {

    private Teacher mTeacher; // teacher
    private Group mGroup; // group
    private Subject mSubject; // subject
    private int mPeriod; // period

    public Course(Teacher teacher, Group group, Subject subject, int period) {
	setGroup(group);
	setSubject(subject);
	setTeacher(teacher);
	setPeriod(period);
    }

    public void set(Teacher teacher, Group group, Subject subject) {
	setGroup(group);
	setSubject(subject);
	setTeacher(teacher);
    }

    public Subject getSubject() {
	return mSubject;
    }

    public void setSubject(Subject subject) {
	mSubject = subject;
    }

    public Group getGroup() {
	return mGroup;
    }

    public void setGroup(Group group) {
	mGroup = group;
    }

    public Teacher getTeacher() {
	return mTeacher;
    }

    public void setTeacher(Teacher teacher) {
	mTeacher = teacher;
    }

    public boolean isFreeAtTimeslot(int timeslot) {
	return mTeacher.isFreeAtTimeslot(timeslot) 
		&& mGroup.isFreeAtTimeslot(timeslot);
    }

    public void fillTimeslot(int timeslot) {
	mTeacher.fillTimeslot(timeslot);
	mGroup.fillTimeslot(timeslot);
    }

    public void freeTimeslot(int timeslot) {
	mTeacher.freeTimeslot(timeslot);
	mGroup.freeTimeslot(timeslot);
    }

    public int getPeriod() {
	return mPeriod;
    }

    public void setPeriod(int period) {
	mPeriod = period;
    }
}
